<?
include ('../../config/config.php');
$q = mysql_query("SELECT t.NAMA_TEAM as Nama, t.ID_TEAM as id, COUNT(k.ID_PEKERJAAN) as jumlah FROM team as t INNER JOIN biodata as b ON t.ID_TEAM=b.ID_TEAM INNER JOIN pekerjaan as k ON b.NIP=k.NIP WHERE b.BIO_NIP = '" . $_SESSION['NIP'] ."' GROUP BY t.NAMA_TEAM");
$qr = mysql_query("SELECT t.NAMA_TEAM as Nama, t.ID_TEAM as id, COUNT(k.ID_PEKERJAAN) as jumlah FROM team as t INNER JOIN biodata as b ON t.ID_TEAM=b.ID_TEAM INNER JOIN pekerjaan as k ON b.NIP=k.NIP WHERE k.ID_STATUS_PEKERJAAN = 2 AND b.BIO_NIP ='".$_SESSION['NIP']."' GROUP BY t.NAMA_TEAM");
//$q = mysql_query("SELECT t.NAMA_TEAM as Nama, b.ID_TEAM as id ,count(p.ID_PEKERJAAN) as 'Jumlah Pekerjaan' FROM team as t INNER JOIN biodata as b ON t.ID_TEAM = b.TEAM INNER JOIN pekerjaan as p WHERE b.BIO_NIP = '" . $_SESSION['NIP'] ."' AND GROUP BY b.ID_TEAM");
$qd = mysql_query("SELECT t.NAMA_TEAM as Nama, t.ID_TEAM as id, COUNT(k.ID_PEKERJAAN) as jumlah FROM team as t INNER JOIN biodata as b ON t.ID_TEAM=b.ID_TEAM INNER JOIN pekerjaan as k ON b.NIP=k.NIP WHERE k.ID_STATUS_PEKERJAAN = 3 AND b.BIO_NIP ='".$_SESSION['NIP']."' GROUP BY t.NAMA_TEAM");
$qp = mysql_query("SELECT t.NAMA_TEAM as Nama, t.ID_TEAM as id, COUNT(k.ID_PEKERJAAN) as jumlah FROM team as t INNER JOIN biodata as b ON t.ID_TEAM=b.ID_TEAM INNER JOIN pekerjaan as k ON b.NIP=k.NIP WHERE k.ID_STATUS_PEKERJAAN = 1 AND b.BIO_NIP ='".$_SESSION['NIP']."' GROUP BY t.NAMA_TEAM");
//$qr = mysql_query("SELECT b.NAMA as Nama, b.NIP as NIP ,count(p.ID_PEKERJAAN) as 'Jumlah Pekerjaan' FROM pekerjaan as p INNER JOIN biodata as b ON p.NIP = b.NIP WHERE p.ID_STATUS_PEKERJAAN = 2 AND b.BIO_NIP = '" . $_SESSION['NIP'] ."' GROUP BY p.NIP");
?>